placessidebar: Don't create a GtkWindow for drag icons
authorTimm Bäder <mail@baedert.org>
Fri, 23 Feb 2018 10:08:53 +0000 (11:08 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 23 Feb 2018 10:08:53 +0000 (11:08 +0100)
Just use the drag_widget we create before, since GtkWindow drag icons
are not allowed anymore.

gtk/gtkplacessidebar.c

index bd40719e35174b819475ecd1fb8a5568837611bd..0d6c3ea68aae40c05b5b2ef795017f2b881cffc2 100644 (file)
@@ -1738,22 +1738,18 @@ drag_begin_callback (GtkWidget      *widget,
   GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
   GtkAllocation allocation;
   GtkWidget *drag_widget;
-  GtkWidget *window;
 
   gtk_widget_get_allocation (sidebar->drag_row, &allocation);
   gtk_widget_hide (sidebar->drag_row);
 
   drag_widget = GTK_WIDGET (gtk_sidebar_row_clone (GTK_SIDEBAR_ROW (sidebar->drag_row)));
-  window = gtk_window_new (GTK_WINDOW_POPUP);
   sidebar->drag_row_height = allocation.height;
-  gtk_widget_set_size_request (window, allocation.width, allocation.height);
+  gtk_widget_set_size_request (drag_widget, allocation.width, allocation.height);
 
-  gtk_container_add (GTK_CONTAINER (window), drag_widget);
-  gtk_widget_show (window);
-  gtk_widget_set_opacity (window, 0.8);
+  gtk_widget_set_opacity (drag_widget, 0.8);
 
   gtk_drag_set_icon_widget (context,
-                            window,
+                            drag_widget,
                             sidebar->drag_row_x,
                             sidebar->drag_row_y);
 }